<script setup>
    import { reactive, ref } from "vue";
    import Child from "./child.vue";

    // 子传父    
    const web = reactive({
        name: "laoda",
        url: "laoda.com"
    })

    const user = ref(0)

    const emitsGetWeb = (data) => {
        console.log("emitsGetWeb data: ", data);
        web.url = data.url;
    }

    const emitsUserAdd = (data) => {
        console.log("emitsUserAdd data: ", data);
        user.value += data
    }

</script>

<template>
    <Child @getWeb="emitsGetWeb" @userAdd="emitsUserAdd" />
    <br />
    {{ web.url }} ------ {{ user }}

</template>

<style scoped>

</style>